﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Class_Entity;
using BussinessObject;
using System.Data;
using System.Data.SqlClient;

public partial class WebApplication_Resume : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["RoleCode"] == null)
        {
            HttpContext.Current.Response.Write("<script type='text/javascript'>alert('" + "You have to login to up your resume ..." + "')");
            Response.Redirect("Login.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Users us = new Users();
        BOUsers bus = new BOUsers();
        us.Username = Session["Username"].ToString();
        us.CVURL =Session["Username"] + FileUpload1.FileName;
        if (!FileUpload1.FileName.Equals(""))
        {
            bus.Add_CVurl(us);
            FileUpload1.SaveAs(Server.MapPath("~\\WebApplication\\Resume\\UserResume\\"+Session["Username"] + FileUpload1.FileName));
            HttpContext.Current.Response.Write("<script>alert('Upload success !')</script>");
        }
    }
}